UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3I+ZAnCpxy/xRMLTwJ9kYA4lsxILs/uSDHpuiT1yCCk='
WHERE
key_id = 'b2afe5745186839808ecc77febb1af271e4b5f874ff771bcdaec64db96aec8f9'
AND (
token = '3I+ZAnCpxy/xRMLTwJ9kYA4lsxILs/uSDHpuiT1yCCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)