UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'roIkB8F9hek89TDLGCaaFpURv6pMcvM0+zSHvZgmNVE='
WHERE
key_id = 'e2b55c996e37f2fbf15a9d74d68f4a1aeace54a5229318f8c065495407e4f3d1'
AND (
token = 'roIkB8F9hek89TDLGCaaFpURv6pMcvM0+zSHvZgmNVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)