UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFbuGww9YhI09usXU7ElarC8qO2cFsFWzXgznxH8Oqg='
WHERE
key_id = '986a4f27a7657771374b706b5e4eecdfa74940b0fe1552375eaec11506e77826'
AND (
token = 'EFbuGww9YhI09usXU7ElarC8qO2cFsFWzXgznxH8Oqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)