UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qOAr/N8qPoNBbZqJB95AaJLSq4v02HrmJ3S06+wgk9s=' 
WHERE 
  key_id = '4556c54350f7f94ff1da40c432c47e55f2afaa56188258bad0aff451875e78dc' 
  AND (
    token = 'qOAr/N8qPoNBbZqJB95AaJLSq4v02HrmJ3S06+wgk9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035