UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd0AMML8WxNX/jYLxUQTEwdSuIfSMlvd7S/xFwlLGV10=' 
WHERE 
  key_id = '2027df591e56efc8290bcf13136bcd11fb40d16020b84d86dbd82667a7816e0f' 
  AND (
    token = 'd0AMML8WxNX/jYLxUQTEwdSuIfSMlvd7S/xFwlLGV10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030