UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PKq8L0ssU0Oiwh/Rqw0bYX36FQemghTykgO7b/QdcLE=' 
WHERE 
  key_id = '0c9f8b55bf6d100b6bffba7598172ba27d7ffb567809c3682fa0e7278cc9f595' 
  AND (
    token = 'PKq8L0ssU0Oiwh/Rqw0bYX36FQemghTykgO7b/QdcLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037