UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ezbqlsrBaiskVx72KOiVmfT4FjxaGSMO8XBKngueXTc=' 
WHERE 
  key_id = '88f2c8a2230fca8dcdcc4a5eed57b18631d6dd4d3d87c4838f89fbb0f722f7b8' 
  AND (
    token = 'ezbqlsrBaiskVx72KOiVmfT4FjxaGSMO8XBKngueXTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024