UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v71FhTrxf9hK7vrSJ/aAiwPYRDiL/PjN9quZWlxQb9Y='
WHERE
key_id = 'c47444506180a723d84f5e92c8c514f77ea384e6590f2f46399ed6353a393f5a'
AND (
token = 'v71FhTrxf9hK7vrSJ/aAiwPYRDiL/PjN9quZWlxQb9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)