UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vU4iPK8w/KHXQ5hBRdGnq4TlHIMaRdy1OlZPTjL3GL4=' 
WHERE 
  key_id = 'f88cc888a23dc35197463a776e1a7f7fc152979cf7e1cce970887040e3ea77f7' 
  AND (
    token = 'vU4iPK8w/KHXQ5hBRdGnq4TlHIMaRdy1OlZPTjL3GL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048