UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pejtd0Sxb8d+ID4VM1A9YSHKlfIbSw0uCsx12fSnh90=' 
WHERE 
  key_id = '6bcd47edbf3a8744f16bc2249f491f1e8f56e19c93bdfce10af8075bdbc57ffb' 
  AND (
    token = 'Pejtd0Sxb8d+ID4VM1A9YSHKlfIbSw0uCsx12fSnh90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069