UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oYZE2He3mm/w1lUXHzTxBeFoK/f5eLHbbGUYyLyDfwg=' 
WHERE 
  key_id = '1c78dba1d5b31445481a5ef4d980070a5f83c39e398ad2a4d1013d88a5f5a9eb' 
  AND (
    token = 'oYZE2He3mm/w1lUXHzTxBeFoK/f5eLHbbGUYyLyDfwg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030