UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5k1j29/6ro7BSFFCgYhfu6P8k+7uluq44LVVD8VMyB0=' 
WHERE 
  key_id = '870693937afa901f7b4294f0a8c3ffcdeb52be748fb4e0cc9694ba091f6bd612' 
  AND (
    token = '5k1j29/6ro7BSFFCgYhfu6P8k+7uluq44LVVD8VMyB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029