UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43Z46C6oSOGsINpuSoVaoxPPK8qu4XpotOZNTonQblU=' 
WHERE 
  key_id = '20828dafdb64ae658f717d874995337cd269d747b96db7fbec1be7d2c8e14fa6' 
  AND (
    token = '43Z46C6oSOGsINpuSoVaoxPPK8qu4XpotOZNTonQblU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028