UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IV3i+EhGztEShyzP/0g4HQjs/v4AgzSqhvtpGmYW5r4='
WHERE
key_id = '4c42dce12ca1727e63f26ae603d41cb47f77e71c5bde251b4a8ae6afbbb0f753'
AND (
token = 'IV3i+EhGztEShyzP/0g4HQjs/v4AgzSqhvtpGmYW5r4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)