UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V/iCaG49lSvvpdwOz+wS2jlvfA+3qWSd8/Zvy+l+gtQ=' 
WHERE 
  key_id = '9c0ef5c8b180a62b35fe2882330a2f56b72ea9c0bfbcca0997ad6e340a464633' 
  AND (
    token = 'V/iCaG49lSvvpdwOz+wS2jlvfA+3qWSd8/Zvy+l+gtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027