UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oxA0/N14+qUUX17FGpU3NWCfZrWOgmnpZOljD79YCxM='
WHERE
key_id = '95040e27a06cce6add1d262f557966dfa4ada06f589f27ba8e24467735ce380f'
AND (
token = 'oxA0/N14+qUUX17FGpU3NWCfZrWOgmnpZOljD79YCxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)