UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zv6+J2UWrsos5q7/V18Q8sppqIGmZGOdhq7JVOhFMTg='
WHERE
key_id = 'f6b4ce81f4b6eadb163f0e3af7f12215dd0e581c3a244b425b03f628848012c6'
AND (
token = 'zv6+J2UWrsos5q7/V18Q8sppqIGmZGOdhq7JVOhFMTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)