UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B86y+Z1h2XqdNxSJKdFcVOsICbw77YmcWeRfxg/cpcM=' 
WHERE 
  key_id = 'd828d7a4c47bc98a6b109034a79f9053dad3f4908dbe5d7dbc52488b224e87ef' 
  AND (
    token = 'B86y+Z1h2XqdNxSJKdFcVOsICbw77YmcWeRfxg/cpcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024