UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dSteRDuaVe0xYU5Mmv65BUeg+9x+ocGrmSGyBYsrQ2k=' 
WHERE 
  key_id = '4033f2620f6fad2d731be61d8165b67a688711ff95ca01c210bccf227a8451fe' 
  AND (
    token = 'dSteRDuaVe0xYU5Mmv65BUeg+9x+ocGrmSGyBYsrQ2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014