UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S5MCREHaxk+TTpnpMZl1kaLXKfnI7duLrRU1TlvAt78=' 
WHERE 
  key_id = '263cf554f436ff253d024dd2c48799f255d10edcde767e0c5c3167892166f505' 
  AND (
    token = 'S5MCREHaxk+TTpnpMZl1kaLXKfnI7duLrRU1TlvAt78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024