UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '303GMHVVU9SMItN7vTCAzlkml81suDUPINZGXY6rFao=' 
WHERE 
  key_id = 'c7a1ee1c661813950b3ebc7b83f9ba1ddc17040bb33a4c01f151d390a54081b4' 
  AND (
    token = '303GMHVVU9SMItN7vTCAzlkml81suDUPINZGXY6rFao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035