UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oQyHdHo2p3xCuv/v6+iS7HlkmOugSbqfEvgRDpVS3I0='
WHERE
key_id = '3e01956e8b62a681ff5db01b45a775e5753609cd93bfcb14476a8e24fdb3415f'
AND (
token = 'oQyHdHo2p3xCuv/v6+iS7HlkmOugSbqfEvgRDpVS3I0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)