UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NBDKmZjV4qkjmD+gnvyjcw1V/KsUNQnf8s56CChbkg='
WHERE
key_id = '0bae0fa410d17410c4404611bac1f41f805ad99d252914ddc106383dab9fdae0'
AND (
token = '/NBDKmZjV4qkjmD+gnvyjcw1V/KsUNQnf8s56CChbkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)