UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bkuofh3nBun/ZqUVQuZleAwTxqc3dHowxyQdgw+927c=' 
WHERE 
  key_id = '6e5e46d97c9757e07a833fde13760259e61fbec4c3e83b1eb48007ea6e7167fe' 
  AND (
    token = 'Bkuofh3nBun/ZqUVQuZleAwTxqc3dHowxyQdgw+927c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016