UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RdZcRl0f02898ragkfIpRPAVC65QkdsaFNqWkbx2kJ8='
WHERE
key_id = '09486a3dff789082af7048975fbcf600ad996ee50240f7c101e99aec254ff05e'
AND (
token = 'RdZcRl0f02898ragkfIpRPAVC65QkdsaFNqWkbx2kJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)