UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kk6AjXeX7WoGcZvprI6bfA4UedUCCzRfvHUcyCcnkQ0=' 
WHERE 
  key_id = '1d8aa59fd220a89b92e857248af0b6fc5389b12db35a2f905025c122427307e4' 
  AND (
    token = 'kk6AjXeX7WoGcZvprI6bfA4UedUCCzRfvHUcyCcnkQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019