UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dFB/oiZt46D2WfrNovndgk3JvmIOCSexvXiB493gk/4=' 
WHERE 
  key_id = '23e87ec3d407f4c83670c6ca60e99da23890f2b2a13cdffede385b84771c4a5f' 
  AND (
    token = 'dFB/oiZt46D2WfrNovndgk3JvmIOCSexvXiB493gk/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038