UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u3c8GRn2cwg63DRRWyfnE3pSrRsIlV3lgmcpR1ae4QQ=' 
WHERE 
  key_id = '8499a729f7355b3c2abf55a5fade9372c8c43053608487ac916b31a3f7d6d7af' 
  AND (
    token = 'u3c8GRn2cwg63DRRWyfnE3pSrRsIlV3lgmcpR1ae4QQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030