UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0g1M8IbxNT5efNeBNxXZ/Aow1QHstolvpxixLQFFyoo='
WHERE
key_id = 'acc1306b7b3350a7cdf5de569bb97dddc0b37c6e395f594ab122c009922c49cc'
AND (
token = '0g1M8IbxNT5efNeBNxXZ/Aow1QHstolvpxixLQFFyoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)